<template>
  <div class="app-container" v-loading="loading">
    <el-table :data="tableData" border style="width: 100%; margin-top: 10px" show-overflow-tooltip>
      <el-table-column label="投料内容" prop="matName" />
      <el-table-column label="投料批号" prop="feedingBatchNo" width="140" />
      <el-table-column label="投入数量" prop="inputQty" />
      <el-table-column label="单位" prop="inputUnit" />
      <el-table-column label="投料时间" prop="feedingTime" />
      <el-table-column label="操作人" prop="operator" />
      <el-table-column label="记录时间" prop="createTime" />
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script setup name="Data">
import { listFeeding } from "@/api/productionMgt/feeding";
import { ref, reactive, toRefs, onMounted } from "vue";
const tableData = ref([]);
const total = ref(0);
const loading = ref(false);
const props = defineProps(["datas"]);
const { datas } = toRefs(props);
const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    name: undefined,
  },
});

const { queryParams } = toRefs(data);
function getList() {
  console.log(datas.value, "===datas.value");
  loading.value = true;
  // queryParams.value.factory = datas.value.factory;
  // queryParams.value.workshopCode = datas.value.workshopCode;
  // queryParams.value.productLine = datas.value.productLine;
  queryParams.value.sectionCode = datas.value.sectionCode?.join(",");
  queryParams.value.classesCode = datas.value.classesCode;
  queryParams.value.orderCode = datas.value.orderCode;
  queryParams.value.prodDate = datas.value.prodDate;
  listFeeding(queryParams.value).then((response) => {
    tableData.value = response.rows;
    total.value = response.total;
    loading.value = false;
  });
}
getList();
onMounted(async () => {});
</script>
<style lang="scss" scoped></style>
